import { get, post,patch,put } from '../../utils/request';

//密码登录
export function loginAPi(obj) {

  return post('login', obj);
}

//快捷登录
export function quickLoginAPi(obj) {
    console.warn('快捷登入。。。。。。。。。。。。。。。。');
    return post('/login/quick', {mobile: obj.mobile, verifyCode: obj.mobileVerify});
}

//快捷登录获取手机验证码
export function verifyAPi(obj) {
   // console.log(obj)
    return get(`/login/verify/${obj.mobile}`, obj);
}

//注册
export function regAPi(obj) {
    return post('/member/register', obj);
}

//注册获取验证码
export function regVerifyAPi(obj) {
    return get(`/member/verifycode/${obj.mobile}`, obj);
}

//根据旧密码修改会员密码
export function memberPwdAPi(obj) {
    return put('/member/password/oldpwd', obj);
}

//修改支付密码
export function payPwdAPi(obj) {
    return put('/member/payment/passwd', obj);
}
//登录成功后调购物车接口
export function goCartAPi() {
    return post('/cart/sync');
}

// 判断。。。。
export function getRecoverApi(obj) {
    return get('/member/chk/code', obj);
}
//  找回密码验证
export function postMobileApi(obj) {
    return get('/member/check/code', obj);
}
//  找回密码手机验证
export function mobileApi(obj) {
    return put('/member/password/mobile', obj);
}

//  找回密码获取手机短信验证码、、、、、、
export function getMobileVerifyApi(obj) {
    return get('/member/send/code', obj);
}

//用户协议
export function UserProtocol() {
    // console.log(obj)
    return get(`/index/user/protocol`);
}
export function codeToken(obj) {
    return get(`/rest/api/v6.0/login/token/${obj.code}`, obj);
}